<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="2" />
<meta name="acc" content="0" />
<title>帐号管理</title>
<!--  通用情况下 不引入 js css  表单验证  js 放置到页面中 -->
<%-- ui tabs --%>

<script type="text/javascript"
	src="<c:url value='/ext/ui/jquery-ui-1.8.12.custom.min.js'/>"></script>
<link href="${ctx}/styles/lightness/jquery-ui-1.8.12.custom.css"
	rel="stylesheet" />
<script>
	$(document).ready(function(){
		$("#addOrg").click(function(){
			var typeIdValue = ${typeId};
			var url;
			var obj = new Object();
			if("2"==typeIdValue){
				 url = "${ctx}/project/org/designorg!input.action?typeId=${typeId}";
			}else if("3"==typeIdValue){
				url="${ctx}/project/org/supervisoryorg!input.action?typeId=${typeId}";	
			}else if("4"==typeIdValue){
				url="${ctx}/project/org/constructorg!input.action?typeId=${typeId}";	
			}
			
			mm = showDialogWindow(url);
			if (mm != null) {
				document.getElementById("design").click();
				//window.document.location.replace(usl);
			}
		});
		$("#colBtn").click(function(){
			window.close();
		});
		$("#addDept").click(function(){
			var orgId = $("input[name='orgId']:checked").val();
			if(null==orgId||""==orgId){
				alert("请选择单位!");
				return false;
			}
			var item1 = $("input:checked").attr("id");
			var math = item1.substring(5, 6);
			var orgName = $("#orgName" + math).html();
			if(confirm("是否创建部门!")){
				location.href="${ctx}/project/sign/org/department!input.action?organizationId="+orgId+"&orgName="+orgName;
			}else{
				location.href="${ctx}/project/sign/org/department!save.action?organizationId="+orgId;
			}
		});
		
	});
</script>
</head>
<body>

<table width="200" border="0" cellspacing="0" cellpadding="1">
	<tr>
		<th>选择</th>
		<th>单位名称</th>
		<th>主管部门</th>
		<th>单位类型</th>
		<th>成立时间</th>
		<th>操作</th>
	</tr>
	<c:forEach items="${page.result}" var="org" varStatus="orgNum">
		<tr>
			<td><input id="orgId${orgNum.count}" name="orgId"  type="radio" value="${org.id}" /></td>
			<td id="orgName${orgNum.count}">${org.orgName }</td>
			<td>${org.burderDep }</td>
			<c:choose>
				<c:when test="${org.type=='1'}">
					<td>建设单位</td>
				</c:when>
				<c:when test="${org.type=='2'}">
					<td>设计单位</td>
				</c:when>
				<c:when test="${org.type=='3'}">
					<td>监理单位</td>
				</c:when>
				<c:when test="${org.type=='4'}">
					<td>施工单位</td>
				</c:when>
				<c:when test="${org.type=='5'}">
					<td>检测单位</td>
				</c:when>
				<c:otherwise>
					<td>集团</td>
				</c:otherwise>
			</c:choose>
			<td>${org.finishDate }</td>
			<td><a href="${ctx}/project/org/organization!input.action?id=${org.id}">查看</a></td>
		</tr>
	</c:forEach>
</table>
<div class="type-button"><input id="addOrg"  
	type="button" class="submit" value="新增" />&nbsp;&nbsp;&nbsp; <input id="addDept"
	  type="button" value="确定"  />&nbsp;&nbsp;&nbsp;
	<c:if test="${fn:length(param.decorator)!=0}">
	<input  type="button"
	value="返回" class="reset" onclick="history.back()"/>
	</c:if>
	<c:if test="${fn:length(param.decorator)==0}">
	<input id="colBtn"  type="button"   value="关闭" class="reset" />
	</c:if>
</div>
</body>
</html>
